package com.icss.clothes.util;
import java.text.SimpleDateFormat;
import java.util.Date;


public class RandomUtil {


    public static String generateOid(){
        StringBuffer orderIdStrBuf = new StringBuffer();
        SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmss");
        String dfdate = df.format(new Date());
        orderIdStrBuf.append(dfdate);

        Integer value = 1;
        do {
            value = (int)(Math.random() * 1000);
        }while (value.intValue() < 100 || value.intValue() >= 1000);
        orderIdStrBuf.append(value);
        return orderIdStrBuf.toString();
    }


    public static void main(String[] args) {
        try {
            String s = generateOid();
            System.out.println(s);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}